// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()
//event:调用云函数时传递的参数
//context:包含了调用的调用信息和运行状态
  const db = cloud.database()
  let collect = await db.collection("user").where({
    username:event.username,
    pwd:event.pwd
  }).get()

  return collect.data
}